// components/select1/select1.js
import store from "../../store/index";
import create from "../../utils1/create"
create.Component(store, {
  use: ['zdy'],
  /**
   * 组件的属性列表
   */
  properties: {},

  /**
   * 组件的初始数据
   */
  data: {
    date1: "",
    date2: ""
  },

  /**
   * 组件的方法列表
   */
  methods: {
    getDateTime(e) {
      console.log(this.properties)
      console.log(e.detail.value)
      this.data.date1 = e.detail.value
      this.setData({
        date1: this.data.date1
      })
      store.data.zdy.date1 = this.data.date1
      this.settout()
    },
    getDateTime1(e) {
      console.log(this.properties)
      console.log(e.detail.value)
      this.data.date2 = e.detail.value
      this.setData({
        date2: this.data.date2
      })
      store.data.zdy.date2 = this.data.date2
      this.settout()
    },
    settout() {
      if (this.data.date1 !== "" && this.data.date2 !== "") {
        this.triggerEvent('myevent1', {
          Begin_Year: this.data.date1,
          End_Year: this.data.date2
        })
      }
    }
  }
})